package com.example.demo.demos.test;

import com.example.demo.demos.web.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;

@Configuration
public class UseController {
    @Autowired
    @Qualifier("user1")
    private User user;

    @Resource(name = "user1")
    private User userA;
    public void doController(){
        System.out.println(user + "\n" + user.hashCode());
        System.out.println(userA + "\n" + userA.hashCode());
        System.out.println(user == userA);
    }
}
